package com.whosly.strategy.annotation;

import com.whosly.strategy.registrar.StrategyRegistrar;
import com.whosly.strategy.registrar.container.ContainerSpringRegistrar;
import org.springframework.context.annotation.DeferredImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author yueny09 <deep_blue_yang@126.com>
 * @Date 2019-09-04 14:22
 */
@Deprecated
public class StrategyConfigurationSelector implements DeferredImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        List<String> result = new ArrayList<String>();
        result.add(StrategyRegistrar.class.getName());

        result.add(ContainerSpringRegistrar.class.getName());

//        result.add(ContainerRegistrar.class.getName());
//        // AfterRegistrar 注入顺序晚于 ManageSpringBeans， 所以 ManageSpringBeans 比 AfterRegistrar 先实例化
//        result.add(ContainerRegistrar.AfterRegistrar.class.getName());

        return result.toArray(new String[result.size()]);
    }
}
